package com.hellobike.haxing.modules.product.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hellobike.haxing.modules.product.mapper.typehandler.JSONObjectHandler;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: SKU
 * @Author: haxing-boot
 * @Date:   2020-01-10
 * @Version: V1.0
 */
@Data
@TableName(value = "t_sku", autoResultMap = true)
public class Sku implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.AUTO)
    private Long id ;
	/**商品id*/
	@Excel(name = "商品id", width = 15)
    private Long spuId ;
	/**图片*/
	@Excel(name = "图片", width = 15)
        private String image ;
	/**售价*/
	@Excel(name = "售价", width = 15)
        private BigDecimal price ;
	/**提成比例*/
	@Excel(name = "提成比例", width = 15)
        private BigDecimal commissionRate ;
	/**规格属性值*/
	@Excel(name = "规格属性值", width = 15)
	@TableField(typeHandler = JSONObjectHandler.class)
        private JSONObject dimensionValues ;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
        private Date createTime ;
	/**修改时间*/
	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
        private Date updateTime ;
	/**创建人*/
	@Excel(name = "创建人", width = 15)
    private Integer createBy ;
	/**修改人*/
	@Excel(name = "修改人", width = 15)
    private Integer updateBy ;
	/**是否删除：0-否 1-是*/
	@Excel(name = "是否删除：0-否 1-是", width = 15)
      @TableLogic
      private Integer deleted ;
	/**sku编码*/
	@Excel(name = "sku编码", width = 15)
        private String skuCode ;
	/**成本价*/
	@Excel(name = "成本价", width = 15)
        private BigDecimal cogsPrice ;
	/**长*/
	@Excel(name = "长", width = 15)
        private Integer length ;
	/**宽*/
	@Excel(name = "宽", width = 15)
        private Integer width ;
	/**高*/
	@Excel(name = "高", width = 15)
        private Integer heigth ;
	/**69码*/
	@Excel(name = "69码", width = 15)
        private String barcode ;

	@ExcelProperty(index = 'J' - 'A')
	@Excel(name = "划线价", width = 15)
	private BigDecimal crossedPrice;
}
